# -*- codeing = utf-8 -*-
# @Time : 2021/2/28 14:19
# @Atuthor: 朱朱
# @File: 157综合练习.py
# @Software: PyCharm
import json
code_list = []

try:
    with open('youbian.txt', 'r', encoding='utf8') as file:
        while True:
            content = file.readline().strip(',\n')
            # .strip(',\n') 以,和换行,为结尾
            if not content:
                break
            x = json.loads(content)
            code_list.append(x)
except Exception as e:
    print(e)

x = input('请输入一个身份证开头前六位:')
for code in code_list:
    if str(code[0]) == x:
        print(code)
        break
else:
    print('没有找到对应的城市')